import{Observable} from "rxjs/internal/Observable";
import {environment} from "../../environments/environment";
declare module 'rxjs/internal/Observable'{
  interface Observable<T>{
    debug:(...any)=>Observable<T>
  }
}
export const debug = Observable.prototype['dubug']= (message:string)=>{
       console.log(Observable)
  return this.tap(
        (next)=> {
          if (!environment.production) {
            console.log(message, next)
          }
        },
        (err)=>{
          if (!environment.production) {
            console.log('<ERROR>',message,err)
          }
        },
        ()=>{
          if(!environment.production){
            console.log('Complete-');
          }
        }
      )
}
